<template>
  <base-breadcrumb>
    <template>
      <a-card>
        <titleName title="信息详情"></titleName>
        <a-form-model
          :model="form"
          :labelCol="{ lg: { span: 6 }, sm: { span: 6 } }"
          :wrapperCol="{ lg: { span: 16 }, sm: { span: 16 } }"
        >
          <a-row :gutter="24">
            <a-col :md="8" :sm="8">
              <a-form-model-item label="名称：">
                <span>{{form.name}}</span>
              </a-form-model-item>
            </a-col>
            <a-col :md="8" :sm="8">
              <a-form-model-item label="所属分公司：" prop="branchComId">
                <span>{{form.branchComName}}</span>
              </a-form-model-item>
            </a-col>
            <a-col :md="8" :sm="8">
              <a-form-model-item label="所属项目：" prop="branchComId">
                <span>{{form.projectName}}</span>
              </a-form-model-item>
            </a-col>

            <a-col :md="8" :sm="8">
              <a-form-model-item label="交底组织人">
                <span>{{form.structureArea}}</span>
              </a-form-model-item>
            </a-col>
            <a-col :md="8" :sm="8">
              <a-form-model-item label="交底日期">
                <span>{{form.contractStartDate}}</span>
              </a-form-model-item>
            </a-col>
            <a-col :md="8" :sm="8">
              <a-form-model-item label="参与人员">
                <span>{{form.contractEndDate}}</span>
              </a-form-model-item>
            </a-col>
            <a-col :md="8" :sm="8">
              <a-form-model-item label="当前状态：">
                <span v-if="form.auditStatus === 'DRAFT'">草稿</span>
                <span v-if="form.auditStatus === 'SUBMITTED'">已提交</span>
                <span v-if="form.auditStatus === 'PAST'">通过</span>
                <span v-if="form.auditStatus === 'REJECTED'">驳回</span>
              </a-form-model-item>
            </a-col>
            <a-col :md="8" :sm="8">
              <a-form-model-item label="填报人：">
                <span>{{form.createName}}</span>
              </a-form-model-item>
            </a-col>
            <a-col :md="8" :sm="8">
              <a-form-model-item label="填报时间：">
                <span>{{form.createTime}}</span>
              </a-form-model-item>
            </a-col>

            <a-col :md="16" :sm="8">
              <a-form-model-item
                label="附件："
                :labelCol="{ lg: { span: 3 }, sm: { span: 5 } }"
                :wrapperCol="{ lg: { span: 18 }, sm: { span: 17 } }"
              >
                <div class="f-col">
                  <span v-for="(item,index) in form.fileInfoVOList" :key="index">
                    {{item.fileName}} &nbsp;
                    <a @click="check()">查看</a>&nbsp;
                    <a
                      :href="'/api/ycloud-file-center/oper/download?access_token='+token+'&fileId='+item.fileId"
                    >下载</a>
                  </span>
                </div>
              </a-form-model-item>
            </a-col>
          </a-row>
        </a-form-model>
      </a-card>
    </template>
  </base-breadcrumb>
</template>
<script>
import { getProjectSettlement } from '@/api/businessAffairs/revenueAndCost'
import Vue from 'vue'
export default {
    name:'a'+Date.now(),    data() {
        return {
            id: '',
            form: {},
            token: '',
        }
    },
    mounted() {
        this.token = Vue.getAcloudProvider().getAccessToken()
        this.id = this.$route.query.id
        console.log(this.id)
        this.getProjectSettlement()
    },
    methods: {
        check() {},
        getProjectSettlement() {
            let params = {
                id: this.id,
            }
            getProjectSettlement(params).then((res) => {
                this.form = res.data
                console.log(this.form)
            })
        },
    },
}
</script>
